package com.lipuwater.agent.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.lipuwater.agent.R;
import com.lipuwater.agent.app.base.ui.BaseLayoutActivity;
import com.lipuwater.agent.utils.onclick.NoDoubleClick;

import butterknife.ButterKnife;
import butterknife.OnClick;
import de.greenrobot.event.EventBus;


public class HelpOrFeedbackActivity extends BaseLayoutActivity {

    private NoDoubleClick mNoDoubleClick = new NoDoubleClick();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setMyContentView(R.layout.activity_help_or_feedback);
        viewToolbarShadow.setVisibility(View.VISIBLE);
        initTitle(R.drawable.icon_aleft, "帮助与反馈");
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn_feedback, R.id.btn_help})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_feedback:
                if (mNoDoubleClick.check()) return;
                startActivity(new Intent(this, FeedbackActivity.class));
                break;
            case R.id.btn_help:
                if (mNoDoubleClick.check()) return;
                Intent intent = new Intent(this, WebViewActivity.class);
                intent.putExtra("title", "帮助");
                intent.putExtra("url", "https://www.baidu.com");
                startActivity(intent);
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
